package com.bling.common.base.dao;

import java.io.Serializable;
import java.sql.SQLException;

import com.bling.common.page.PageResult;

/**
 * 通用DAO接口
 * @author BLingSoft
 * 主要是增删改查，搜索采用lucene搜索引擎
 * 
 * 其他各个操作均继承这个接口，其他接口如果在其他方法可以自行扩展
 */
public interface IBaseDao<T> {
	public void save(T t) throws SQLException;
	public void delete(T t) throws SQLException;
	public void delete(Class<T> clazz,Serializable id) throws SQLException;
	public void delete(String hql) throws SQLException;
	public void delete(String hql,Object[] params) throws SQLException;
	public void update(T t) throws SQLException;
	public void update(String hql) throws SQLException;
	public void update(String hql,Object[] params) throws SQLException;
	public T find(Class<T> clazz,Serializable id) throws SQLException;
	public T find(String hql) throws SQLException;
	public T find(String hql,Object[] params) throws SQLException;
	public int getCount(String hql) throws SQLException;
	public int getCount(String hql,Object[] params) throws SQLException;
	public PageResult<T> pageList(String hql,int from,int num) throws SQLException;
	public PageResult<T> pageList(String hql,Object[] params,int from,int num) throws SQLException;
	public PageResult<T> listAll(String hql) throws SQLException;
	public PageResult<T> listAll(String hql,Object[] params) throws SQLException;
}